#include <iostream>
#include "src/graphe.hpp"
#include "src/noeud.hpp"
#include "src/dijkstra.hpp"

using namespace std;

int main() {
    graphe *g = initGraphe();

    ajoutNoeud(g, (char*) "Coruscant");
    ajoutNoeud(g, (char*) "Alderande");
    ajoutNoeud(g, (char*) "Tatooine");
    ajoutNoeud(g, (char*) "Utapau");
    ajoutNoeud(g, (char*) "Hoth");
    ajoutNoeud(g, (char*) "Bespin");

    ajoutArc(g, (char*) "Coruscant", (char*) "Alderande", 5);
    ajoutArc(g, (char*) "Coruscant", (char*) "Tatooine", 30);
    ajoutArc(g, (char*) "Coruscant", (char*) "Bespin", 23);

    ajoutArc(g, (char*) "Alderande", (char*) "Coruscant", 5);
    ajoutArc(g, (char*) "Alderande", (char*) "Tatooine", 20);
    ajoutArc(g, (char*) "Alderande", (char*) "Utapau", 20);
    ajoutArc(g, (char*) "Alderande", (char*) "Bespin", 25);

    ajoutArc(g, (char*) "Tatooine", (char*) "Coruscant", 30);
    ajoutArc(g, (char*) "Tatooine", (char*) "Alderande", 20);
    ajoutArc(g, (char*) "Tatooine", (char*) "Utapau", 12);
    ajoutArc(g, (char*) "Tatooine", (char*) "Hoth", 15);

    ajoutArc(g, (char*) "Utapau", (char*) "Alderande", 20);
    ajoutArc(g, (char*) "Utapau", (char*) "Tatooine", 12);
    ajoutArc(g, (char*) "Utapau", (char*) "Hoth", 8);
    ajoutArc(g, (char*) "Utapau", (char*) "Bespin", 7);

    ajoutArc(g, (char*) "Hoth", (char*) "Tatooine", 15);
    ajoutArc(g, (char*) "Hoth", (char*) "Bespin", 1);

    ajoutArc(g, (char*) "Bespin", (char*) "Coruscant", 23);
    ajoutArc(g, (char*) "Bespin", (char*) "Alderande", 25);
    ajoutArc(g, (char*) "Bespin", (char*) "Hoth", 1);

    afficherGraphe(g);

    suppressionArc(g, (char*) "Utapau", (char*) "Bespin");

    dijkstra_source(g, g->noeuds[4]);

    dijkstra_source(g, g->noeuds[0]);

    cout << endl << endl << "DESTRUCTION D'ALDERANDE !!!" << endl << endl;

    suppressionNoeud(g, (char*) "Alderande");

    cout << endl << endl << "DESTRUCTION D'UTAPAU !!!" << endl << endl;

    suppressionNoeud(g, (char*) "Utapau");

    afficherGraphe(g);

    testamentGraphe(g);
    return 0;
}
